from openpyxl import load_workbook
class excel():
    def __init__(self,filepath,sheetame):
        self.filepath=load_workbook(filepath)
        self.sheetname=self.filepath[sheetame]
    def getdatafromexcel(self):
        datalist=[]
        for line in self.sheetname:
            tmp_list=[]
            tmp_list.append(line[0].value)
            tmp_list.append(line[1].value)
            tmp_list.append(line[2].value)
            tmp_list.append(line[3].value)
            tmp_list.append(line[4].value)
            tmp_list.append(line[5].value)
            datalist.append(tmp_list)
        return datalist
if __name__ == '__main__':
    filment=r"D:\2211A\PythonProject8\ke\user.xlsx"
    seep="Sheet1"
    dy=excel(filment,seep)
    print(dy.getdatafromexcel())

# pip install openpyxl
from openpyxl import load_workbook

